#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtOpenGL>
#include <QDialog>
#include <QMessageBox>

#include "vobject.h"
#include "particlesystem.h"
#include "loadrawdialog.h"
#include "colorgradientpicker.h"
#include "TerrainHeightMapper.h"
#include "CommonTypes.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void UpdateAnaglyphSwitch(bool value);
    void SwitchCyanBlueAnaglyph(bool value);

private:
    Ui::MainWindow *ui;
    LoadRawDialog* LoadSetup;

    // Datos del objeto reconstruido
    QString ReconstructionURL;
    QString SceneURL;
    QString ShortReconstructionURL;
    int MCxsize, MCysize, MCzsize, MCBitDepth,
        MCIsovalue, MCMaxPoligon,
        MCxmax, MCymax, MCzmax;
    VObject::NORMALMODE MCNormCalc;

    // Informacion util a la aplicacion
    QString IconDir;

private slots:
    void updateStatusBar(QVector3D cameraPos);
    void on_actionMCBuildObject_triggered();
    void BuildMCObject (QString URL,
                        VObject::NORMALMODE,
                        int xsize, int ysize, int zsize,
                        int bitdepth,
                        int isovalue,
                        int maxpoligon,
                        int xmax, int ymax, int zmax);
    void ShowReconstructionInfo (int size, QString dimensions, int bitdepth, int poligoncount,
                                 int vertexcount, int isovalue, int elapsed);
    void WrongThreshold();
    void SwitchLeftPanel();
    void SwitchRightPanel();
    void InsertParticleSystem(QString input);

    // Esto permitira un preview de los cambios en los colores
    // del sistema de particulas actual
    void ChangeParticleSColor(vec4 s);
    void ChangeParticleEColor(vec4 e);

    void on_RebuildButton_clicked();
    void on_UpsideDownButton_clicked();
    void on_GoUpButton_clicked();
    void on_GoDownButton_clicked();
    void on_GoLeftButton_clicked();
    void on_GoRightButton_clicked();
    void on_actionCargar_escena_triggered();
    void on_ToggleParticleMenu_clicked();
    void on_ToggleStep_clicked();
    void on_ToggleSource_clicked();
    void on_ToggleDir_clicked();
    void on_ToggleSize_clicked();
    void on_ToggleTTL_clicked();
    void on_SystemList_currentIndexChanged(const QString &input);
    void LoadParticleSystemData(QString input);
    void on_RebuildSystemButton_clicked();
    void on_StepSizeInput_valueChanged(double arg1);
    void on_StepVarInput_valueChanged(double arg1);
    void on_SourceXInput_valueChanged(double arg1);
    void on_SourceYInput_valueChanged(double arg1);
    void on_SourceZInput_valueChanged(double arg1);
    void on_SourceVarXInput_valueChanged(double arg1);
    void on_SourceVarYInput_valueChanged(double arg1);
    void on_SourceVarZInput_valueChanged(double arg1);
    void on_DirXInput_valueChanged(double arg1);
    void on_DirYInput_valueChanged(double arg1);
    void on_DirZInput_valueChanged(double arg1);
    void on_DirVarXInput_valueChanged(double arg1);
    void on_DirVarZInput_valueChanged(double arg1);
    void on_DirVarYInput_valueChanged(double arg1);
    void on_SizeXInput_valueChanged(double arg1);
    void on_SizeYInput_valueChanged(double arg1);
    void on_SizeZInput_valueChanged(double arg1);
    void on_SizeVarXInput_valueChanged(double arg1);
    void on_SizeVarYInput_valueChanged(double arg1);
    void on_SizeVarZInput_valueChanged(double arg1);
    void on_TTLInput_valueChanged(int arg1);
    void on_TTLVarInput_valueChanged(int arg1);
    void on_AmountInput_valueChanged(int arg1);
    void on_ColorGradientButton_clicked();
    void on_LoadParticleTextureButton_clicked();
    void on_ToggleBlending_clicked();
    void on_SrcBlendingInput_currentIndexChanged(int index);
    void on_DstBlendingInput_currentIndexChanged(int index);
    void on_AlphaFunctionInput_currentIndexChanged(int index);
    void on_AlphaRefInput_valueChanged(double arg1);
    void on_actionRecargar_escena_triggered();
    void on_actionOpenHeightmapEditor_triggered();
};

#endif // MAINWINDOW_H
